package com.xin.data.simbapesa.api;

import java.util.concurrent.TimeUnit;

import okhttp3.ConnectionPool;
import okhttp3.OkHttpClient;

public class HttpClient {

    private static OkHttpClient instance;

    public static OkHttpClient getClient() {
        if (instance == null) {
            instance = new OkHttpClient.Builder()
                    .retryOnConnectionFailure(true)
                    .connectionPool(new ConnectionPool(10, 5, TimeUnit.MINUTES))
                    .connectTimeout(20, TimeUnit.SECONDS)
                    .readTimeout(20, TimeUnit.SECONDS)
                    .build();
        }
        return instance;
    }

}
